<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <child :text="list[item-1]" v-for="(item, index) in 5" :key="index"></child>
    </div>

    <script src="../vue.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    list: ['walk', 'sleep', 'play game', 'swim', 'eat'],
                }
            },
            setup() {
                onBeforeMount(() => {
                   console.log('onBeforeMount');
                })
                onMounted(() => {
                    console.log('onMounted');
                })
                onBeforeUpdate(() => {
                    console.log('onBeforeUpdate');
                })
                onUpdated(() => {
                    console.log('onUpdated');
                })
                onBeforeUnmount(() => {
                    console.log('onBeforeUnmount');
                })
                onUnmounted(() => {
                    console.log('onUnmounted');
                })
                onActivated(() => {
                    console.log('onActivated');
                })
                onDeactivated(() => {
                    console.log('onDeactivated');
                })
                onErrorCaptured(() => {
                    console.log('onErrorCaptured');
                })
            }
        })

        app.component('child', {
            props: ['text'],
            template: `<li>This is a todo:${text}</li>`
        })

        app.mount('#app');
    </script>
</body>

</html>